var express = require('express');
var router = express.Router();
const addTVController = require("../controllers/addTV_controller")
router.post("/add", (req, res) => {
    const {
        TvObj,
        collectionName
    } = req.body

    // console.log(TvObj,collectionName);
    // res.json(TvObj)
    // console.log( req.body);
    // const {
    //     doubanId,
    //     title,
    //     rate,
    //     poster
    // } = req.body
    // {
    //     doubanId: Number(doubanId),
    //     title,
    //     rate: Number(rate),
    //     poster
    // }
    // res.json("result")

    addTVController.addTVitem(TvObj,collectionName, ["添加失败", "添加成功"], (result) => {
        res.json(result)
    })
})
module.exports=router